<?php 
/**
* admin 学校管理，以及学校管理员
*/
class Admin_student_course extends CI_Controller
{
    
    function __construct()
    {
        parent::__construct();
        //登陆状态检测
        if(!$this->session->userdata('r_user_in'))
            redirect('home');
        //权限检测
        if($this->session->userdata('r_role_id') != 1)
            redirect('home');
    }
    function index()
    {
        $data['title']='选课情况管理';
        $this->load->model('school_model');
        $this->load->model('school_admin_model');
        $this->load->model('big_lecture_model');
        $this->load->model('logic_class_model');
        $this->load->model('student_model');


        $lectures = $this->logic_class_model->get_all_order();
        $students = $this->student_model->get_no_course_students();
        $data['lectures'] = $lectures;
        $data['students'] = $students;
        $this->load->view('admin_student_course/index',$data);
    }
   
    function check($id)
    {
        $data['title']='查看学生';

        $this->load->model('school_model');
        $this->load->model('school_admin_model');
        $this->load->model('big_lecture_model');
        $this->load->model('logic_class_model');
        $this->load->model('student_model');

        //$lecture = $this->big_lecture_model->get_by_id($id);
        $students = $this->student_model->get_students_by_course($id);

        $data['students'] = $students;

       
        $this->load->view('admin_student_course/check',$data);
    }

   
}